export default class MainScene extends Phaser.Scene {
    create() {
        // 添加视口动态调整
        this.scale.on('resize', (gameSize) => {
            this.cameras.main.setViewport(0, 0, gameSize.width, gameSize.height);
            this.cameras.main.setZoom(Math.max(
                gameSize.width / 1080,
                gameSize.height / 1920
            ));
        });
        
        // UI元素位置适配
        this.add.image(this.cameras.main.width - 100, 100, 'coin')
            .setScrollFactor(0);
    }

    createParticles() {
        this.add.particles(
            Phaser.Math.Between(200, 800),
            Phaser.Math.Between(400, 1000),
            'particle',
            {
                speed: 100,
                scale: { start: 0.5, end: 0 },
                lifespan: 1000
            }
        );
    }
}